From: Anthony PERARD Date: Thu, 15 Jan 2015 17:55:56 +0000 (+0000) Subject: libxl: Avoid returning empty path from libxl_console_get_tty X-Git-Tag: archive/raspbian/4.8.0-1+rpi1~1^2~3902 X-Git-Url: https://dgit.raspbian.org/%22http://www.example.com/cgi/%22/%22http:/www.example.com/cgi/%22?a=commitdiff_plain;h=260dfd39681b4e9b236e1e211b09dce8c5408e91;p=xen.git libxl: Avoid returning empty path from libxl_console_get_tty This could happen if xenconsoled have not populate the xenstore key yet. Signed-off-by: Anthony PERARD Acked-by: Ian Campbell --- diff --git a/tools/libxl/libxl.c b/tools/libxl/libxl.c index 11cf0e126d..82227e82a7 100644 --- a/tools/libxl/libxl.c +++ b/tools/libxl/libxl.c @@ -1734,7 +1734,7 @@ int libxl_console_get_tty(libxl_ctx *ctx, uint32_t domid, int cons_num, } tty = libxl__xs_read(gc, XBT_NULL, tty_path); - if (!tty) { + if (!tty || tty[0] == '\0') { LOGE(ERROR,"unable to read console tty path `%s'",tty_path); rc = ERROR_FAIL; goto out;